Shape Maps
malloy can create area maps. By currently it uses US maps and state names.
The model and data styles for the subsequent examples is:
export define airports is (explore 'malloy-data.faa.airports' primary key code airport_count is count(*) by_state is (reduce state airport_count ) );
and data styles are
{ "by_state": { "renderer": "shape_map" } }
Run as a simple query.
Run as a turtle.
explore airports | reduce by_state
| by_state |
|---|
Run as a trellis.
explore airports | reduce faa_region airport_count, by_state
| faa_region | airport_count | by_state |
|---|---|---|
| AGL | 4,437 | |
| ASW | 3,268 | |
| ASO | 2,924 | |
| AEA | 2,586 | |
| ANM | 2,102 |
Run as a trellis repeated filtered
explore airports | reduce faa_region airport_count, by_state heliports is by_state : [fac_type :'HELIPORT'] seaplane_bases is by_state : [fac_type :'SEAPLANE BASE']
| faa_region | airport_count | by_state | heliports | seaplane_bases |
|---|---|---|---|---|
| AGL | 4,437 | |||
| ASW | 3,268 | |||
| ASO | 2,924 | |||
| AEA | 2,586 | |||
| ANM | 2,102 |
Malloy